$(function() {
	$('#vue_vm_list div').hide();
});

function save() {
	view.data.year = (view.data.year==''? 0: parseInt(view.data.year));
	view.data.month = (view.data.month==''? 0: parseInt(view.data.month));
	view.data.score = (view.data.score==''? 0: parseInt(view.data.score));

	save_basic(path+'/filialScore/save', {filialScore:view.data}, function() {
		alert('保存成功');
	});
}

function filialScoreFind() {
	if($('#vue_vm_list').length==0) {return;}
	$('#vue_vm_list div').hide();
	var month = $('#year').val() + '-' + $('#month').val();
	var elderSearchVal = $('#elderSearchVal').val();

	find_basic_by_json(path+'/filialScore/find',
			{month: month, elderSearchVal: elderSearchVal}, function(response) {
		$('#vue_vm_list').html(gl_vue_vm_list_html);
		
		for(var i=0; i<response.data.length; i++) {
			for(var j=0; j<response.data.length; j++) {
				response.data[i].filialScoreForms[j].index = j;
			}
		}
		
		new Vue({
			el: '#vue_vm_list',
			data: {
				todos: response.data
			}
		});
		
		$('#vue_vm_list div').show();
	});
}

function deleteBatch() {
	deleteBatch_basic(path+'/filialScore/deleteBatch');
}
